﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Subfaculty.Common.Entities;
using Subfaculty.WebApplication.ViewModels;

namespace Subfaculty.WebApplication.Translators
{
	public class DepartmentTranslator : BaseTranslator<Department, DepartmentViewModel>
	{
		public override DepartmentViewModel Translate(Department source)
		{
			var pe = new DepartmentViewModel();

			pe.Id = source.Id;
			pe.Title = source.Title;
			pe.Abbreviation = source.Abbreviation;

			return pe;
		}

		public override Department TranslateBack(DepartmentViewModel pe, Department entity)
		{
			entity.Id = pe.Id;
			entity.Title = pe.Title;
			entity.Abbreviation = pe.Abbreviation;

			return entity;
		}
	}
}